@extends('company.company')

@section('title','企业中心')
@section('rightcontainer')
<div class="col-xs-10 font-16" style="padding-right: 0;">
    <div class="backgr-color-white bord-1 padd-l-10 padd-t-10">
        <div class="tab-row bord-b font-16">
            <ul>
                <li><strong>评论职位</strong></li>
                <li><strong>用户昵称</strong></li>
                <li style="width: 25%"><strong>评论</strong></li>
                <li><strong>回复状态</strong></li>
                <li style="width: 10%"><strong>操作</strong></li>
            </ul>
        </div>

        @foreach ($comments as $cts)
            <div class="tab-row">
                <ul>
                    <li>{{ count($cts->jobs)>0?$cts->jobs->title:'无' }}</li>
                    <li>{{ $cts->user->name }}</li>
                    <li style="width: 25%">{{ str_limit($cts->content, 30, '...') }}</li>
                    <li>
                        @if($cts->company_id == $cts->to_user_id)
                            <span class="color-1 padd-r-5">已回复</span>
                        @else
                            <span class="color-13 padd-r-5">未回复</span>
                        @endif
                    </li>
                    <li style="width:10%;">

                        <div class="dropdown">
                            <span class="cursor-pointer padd-r-5" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                                操作菜单
                                <img src="{{ asset('/images/front/more_1.png') }}" width="6" height="6">
                            </span>
                            <dl class="dropdown-menu " style="min-width:90px;" aria-labelledby="dropdownMenu1">
                                <dt class="height-20">
                                    <a href="#">
                                        评论列表
                                    </a>
                                </dt>
                                <dt role="separator" class="divider">
                                </dt>
                                <dt class="height-20">
                                    <span class="color-1 cursor-pointer" onclick="reply({{ $cts->company_id }}, {{ $cts->comment_id }}, {{ $cts->job_id }});"  id="reply_btn">回复</span>
                                </dt>
                                <dt role="separator" class="divider">
                                </dt>
                                <dt class="height-20">
                                    <a href="{{ asset('/company/center/comments-' . $type .'?id=' . $cts->comment_id) }}">
                                        删除
                                    </a>
                                </dt>
                            </dl>
                    </div>
                    </li>
                </ul>
            </div>
        @endforeach
    </div>
</div>
{{--引入企业资料公共模块--}}

@include('company.replymodal')
<script type="text/javascript">

    // 头部菜单导航样式
    $(function() {
            $('#nav ul').find('li').attr('class', 'curr').removeClass('curr');
            $('#nav ul li').eq(3).attr('class', 'curr');

            $('#reply_btn').click(function(){
                $('#exampleModal').modal({
                  keyboard: true,
                  remote:"{{ asset('/company/center/comments/replyhtml-1-1') }}"
                })
            })
    });

    function reply(company_id, comment_id, job_id)
    {
        var url = '/company/center/comments/replyhtml-'+company_id+'-'+comment_id+'-'+job_id;
        $('#exampleModal').modal({
          keyboard: true,
          remote:url
        })
    }


</script>
@stop

{{--底部导航--}}
@section('footer')
@parent
@stop

